@import '../../../../variables';

:host-context([dir='rtl']) {
  direction: rtl;
}

:host {
  display: block;

  mat-form-field {
    display: block;
  }
}

.control-row {
  td,
  th {
    padding: 0;
    border: 0 !important;
  }

  td {
    ::ng-deep .mat-mdc-select-value {
      padding-left: $s * 2.25;
      padding-top: $s * 1.25;
      padding-bottom: $s * 1.25;
    }

    &:first-of-type ::ng-deep .mat-mdc-select-value {
      padding-left: $s * 3;
    }

    ::ng-deep .mat-mdc-select-arrow-wrapper {
      padding-right: $s * 1.25;
    }

    &:last-of-type ::ng-deep .mat-mdc-select-arrow-wrapper {
      padding-right: $s * 3;
    }
  }

  mat-select {
    &:hover {
      &:after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: -1;

        @include darkTheme() {
          background: rgba(255, 255, 255, 0.1);
        }
        @include lightTheme() {
          background: rgba(0, 0, 0, 0.1);
        }
      }
    }
  }
}

@media (min-width: $layout-xs) {
  .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-top: $s * 2;
  }
  .col {
    width: 32%;
  }
}

#task-textarea {
  width: 100%;
  @media (min-width: $layout-xs) {
    min-width: 70vw;
  }
}

.wrapper-wrapper {
  position: relative;
  min-height: 60px;

  &.isNoCols {
    text-align: center;
  }
}

.add-col {
  z-index: 2;
  position: absolute;
  top: 0;
  right: -20px;
  transition: $transition-slow;

  .isNoCols & {
    position: absolute;
    top: 10px;
    right: 50%;
    opacity: 1;
  }

  @include mq(xs) {
    opacity: 0;
    .wrapper-wrapper:hover & {
      opacity: 1;
    }
  }
}

.table-wrapper {
  overflow: auto;
  position: relative;
  z-index: 1;
  margin: 0 -20px $s;

  ::ng-deep table {
    width: 100%;
  }

  ::ng-deep td {
    white-space: normal;

    &:last-child {
      white-space: normal;
    }
  }

  tr:first-of-type td {
    @include extraBorder;
  }

  th {
    //@include mat-css-color-and-contrast(500);
  }

  th,
  td {
    text-align: center;

    &.TITLES_INCLUDING_SUB,
    &.TITLES {
      text-align: start;
      min-width: 250px;
    }

    &.DATE {
      @include mq(xs) {
        white-space: nowrap;
      }
    }
  }
}

.options-collapsible {
  margin-top: $s * 2;
  text-align: center;
}

.options {
  text-align: left;
  position: relative;

  &:after {
    position: absolute;
    content: '';
    left: -20px;
    right: -20px;
    top: 0;
    border: 1px solid;

    @include darkTheme() {
      border-color: rgba(255, 255, 255, 0.1);
    }

    @include lightTheme() {
      border-color: rgba(0, 0, 0, 0.1);
    }
  }
}

collapsible::ng-deep .collapsible-header {
  text-transform: uppercase;
}
